package cn.wangliang181230.boot.web.springbean;

import cn.wangliang181230.boot.web.properties.MyTestProperties;
import org.springframework.beans.factory.DisposableBean;

import javax.annotation.PostConstruct;

public class MyBean1 implements IMyBean, DisposableBean {

	private MyTestProperties properties;


	public MyBean1(MyTestProperties properties) {
		System.out.println("MyBean: constructor");
		this.properties = properties;
	}

	@Override
	public String execute() {
		System.out.println("MyBean: execute:" + properties.getString());
		return properties.getString();
	}


	@PostConstruct
	public void doInit() {
		System.out.println("MyBean: doInit:" + properties.getString());
	}

	@Override
	public void destroy() throws Exception {
		System.out.println("MyBean: destroy");
	}
}
